<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>我的预约 - 五四宪法历史资料陈列室</title>
    <link rel="stylesheet" href="/static/pc/css/style.css">
    <script src="/static/pc/js/jquery.min.js"></script>
</head>
<body>
<div class="head">
    <img src="/static/pc/img/head.jpg" alt="">
</div>
<div class="main">
    <div class="title_img"><img src="/static/pc/img/title3.png" alt=""></div>
    <div class="top_right">
        {if condition="$Think.session.mobile"}  <span class="login_status">{$Think.session.mobile} </span><a class="login_status" href="home_tuichu" onclick="$('.layer2').show()"> 退出</a>{/if}
        <a href="javascript:history.back(-1)"><img src="/static/pc/img/back.png" alt=""></a>
    </div>

    <div class="comment container">
        <form action="evaluate" method="post" id="formid">
            <input type="hidden" value="{$id}" name="id">
            <input type="hidden" name="evaluate" value="" class="evaluate">
            <textarea name="evcontent" id="" cols="30" rows="10" placeholder="请输入对此次参观博物馆的评价，最多140字。" maxlength="140"></textarea>
            <div class="star">
                <span>满意度：</span>
                <i></i>
                <i></i>
                <i></i>
                <i></i>
                <i></i>
                <span id="message"></span>
            </div>
            <a href="javascript:;" class="submit" onclick="submit()"><img src="/static/pc/img/fabu.png" alt=""></a>
        </form>
    </div>

</div>
<link rel="stylesheet" href="/static/css/bootstrap.min.css">
<script>
    $(function(){
        var num = 0;
        $(".star i").on("click", function () {
            num = 0;
            $('.star').addClass('shin');
            if(!($(this).hasClass('current'))){
                $(this).addClass('current').prevAll().addClass('current').end().nextAll().removeClass('current');
            }else{
                $(this).addClass("current").nextAll().removeClass("current")

            }
            $(".star i").each(function(){
                console.log($(this));
                if($(this).hasClass('current')){
                    num+=1
                }
            })
        })
    })
    function submit(){
        if($('textarea').val() == '' || !($('.star').hasClass('shin'))){
            // alert('请输入评价或点亮星星');
            layer.alert("请输入评价或点亮星星",{
                // icon: 2,
                title:false,
                time:5000
            })

            return false;
        }
        $(".evaluate").val($(".current").length-1);
        $("#formid").submit();
    }
</script>
</body>
</html>